package com.ym521.imgcrop.crop.adapter;

import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.ym521.imgcrop.R;
import com.ym521.imgcrop.widget.RectCropView;

public class SelectViewHolder extends RecyclerView.ViewHolder {
    TextView tvContent;

    public SelectViewHolder(@NonNull View itemView) {
        super(itemView);
        tvContent = itemView.findViewById(R.id.tvContent);
    }

    public void showView(RectCropView.WHRatio ratio) {
        String content = "";
        switch (ratio) {
            case WH1_1:
                content = "1:1";
                break;
            case WH2_1:
                content = "2:1";
                break;
            case WH3_4:
                content = "3:4";
                break;
            case WH4_3:
                content = "4:3";
                break;
            case WH1_2:
                content = "1:2";
                break;
            case WH9_16:
                content = "9:16";
                break;
            case WH16_9:
                content = "16:9";
                break;
        }
        tvContent.setText(content);
    }
}